<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>
<script type="text/javascript">
	var fileNumLimit = 1;
</script>
<blockquote class="layui-elem-quote"><{$action}></blockquote>

<form class="layui-form layui-form-pane" method="post" action="<{$post_url}>" id="form_add_role">
	<input type="hidden" name="id" value="<{$info['id']|default:'0'}>" />
	<div class="layui-form-item">
		<label class="layui-form-label">名称</label>
		<div class="layui-input-block">
			<input type="text" name="name" value="<{$info.name|default:''}>" lay-verify="required" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">副标题</label>
		<div class="layui-input-block">
			<input type="text" name="sub_title" value="<{$info.sub_title|default:''}>" lay-verify="required" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">来源</label>
		<div class="layui-input-block">
			<input type="text" name="source" value="<{$info.source|default:''}>" lay-verify="required" autocomplete="off" class="layui-input">
		</div>
	</div>

	<div class="layui-form-item">
		<input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
		<label class="layui-form-label">图标</label>
		<div class="layui-input-block">
            <div id="uploader2" class="upload_box" style="float:left; width:420px;">
                <div class="queueList">
                    <div id="dndArea2" class="placeholder dndArea">
                        <div id="filePicker2" class="filePicker"></div>
                        <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                    </div>
                </div>
                <div class="statusBar" style="display:none;">
                    <div class="progress">
                        <span class="text">0%</span>
                        <span class="percentage"></span>
                    </div><div class="info"></div>
                    <div class="btns">
                        <div id="filePickerBut2" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                    </div>
                </div>
                <div class="upload_img_input" input_name='image'></div>
            </div>
            <{if isset($info['image']) AND $info['image'] != ''}>
	  			<div class="layui-inline" style="float:left;"><img src="<{$info['image']}>" style="max-height:175px;"/></div>
	  		<{/if}>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">图书详情</label>
			<div class="layui-input-block">
				<textarea id="content" name="description" style="display: none;"></textarea>
			</div>
	</div>
		



	<div class="layui-form-item">
	    <label class="layui-form-label">是否启用</label>
	    <div class="layui-input-block">
	            <{assign var="status" value=$info.status|default:"1"}>
	            <input type="checkbox" <{if $status == 1}> checked <{/if}> name="status" lay-skin="switch" lay-filter="switchTest" value="1" >
	    </div>
  	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">类别</label>
		<div class="layui-input-inline">
			<select name="category_id" lay-verify="required">
				<option value="0" >请选择分类</option>
				<{foreach from=$list item=item}>
				<option value="<{$item['id']}>" ><{$item['name']}></option>
				<{/foreach}>
				
				
			</select>
		</div>
	   
	

		
	</div>

	<div class="layui-input-block">
		<button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>


<{include file="public_html/footer.html"}>

<script>
		layui.use('layedit', function(){
		  var layedit = layui.layedit;
		  layedit.set({
			  uploadImage: {
			    url: '/upload/image'
			  }
			});
		  layedit.build('content'); //建立编辑器
		});
</script>
